﻿namespace Infra.Validation
{
    /// <summary>
    /// A Validation Message representation.
    /// </summary>
    public abstract class ValidationMessage
    {
        /// <summary>
        /// Gets or sets the validation message text.
        /// </summary>
        /// <value>The message.</value>
        public string Message { get; internal set; }

        /// <summary>
        /// Gets a value indicating whether the the error is stopper and need to be corrected or can continue.
        /// </summary>
        /// <value><c>true</c> if this instance is valid; otherwise, <c>false</c>.</value>
        public abstract bool IsStopper { get; }
        
        protected internal ValidationMessage(string message)
        {
            this.Message = message;
        }
        
        //Only allow creation internally or by ValidationResult class.
        internal ValidationMessage()
        {
        }
    }
}

